package com.minibobbo.utilities.spe.actionmodules;


public class SpeActionJetpack extends SpeActionModule {
	private float jetStr = 30;
	private float maxVerticalSpeed = 6;
	/**
	 * Sets the jetpack's lifting strength.
	 * @param strength The strength of the jetpack
	 * @return This object for chaining.
	 */
	public SpeActionJetpack setJetPackStrength(float strength) {
		jetStr = strength;
		return this;
	}

	/**
	 * Sets the maximum vertical velocity that this jetpack can achieve.
	 * @param maxVerticalSpeed The maximum vertical speed in units/sec 
	 * @return This object for chaining.
	 */
	public SpeActionJetpack setMaxVerticalSpeed(float maxVerticalSpeed) {
		this.maxVerticalSpeed = maxVerticalSpeed;
		return this;
	}
	
	@Override
	public void doAction(float delta) {
		parent.physicsVector.y += jetStr * delta;
		if(parent.physicsVector.y > maxVerticalSpeed)
			parent.physicsVector.y = maxVerticalSpeed;
	}

}
